package com.ruoyi.weiriya.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.ruoyi.common.core.domain.entity.WMember;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 用户信息Mapper接口
 * 
 * @author lynn
 * @date 2023-08-01
 */
public interface WMemberMapper extends BaseMapper<WMember>
{

    @Select("SELECT m.*, a.name as area_name " +
            "FROM w_member m " +
            "LEFT JOIN w_area a on a.id = m.area_id ${ew.customSqlSegment}")
    List<WMember> getList(@Param(Constants.WRAPPER) QueryWrapper<WMember> queryWrapper);

    @Select("SELECT m.*, a.name as area_name " +
            "FROM w_member m " +
            "LEFT JOIN w_area a on a.id = m.area_id " +
            "WHERE m.id = #{id}")
    WMember getWMemberById(String id);
}
